<template>
  <el-dialog v-model="open" width="80%" :draggable="true"
  >
    <template #title>
      <div style="text-align: center;font-size: 20px">新增</div>
    </template>

    <div style="background-color: white">
      <OneDayModel ref="oneDayRef" @emitRefreshList="updateList"></OneDayModel>
    </div>

    <template v-if="mode === 'create'" #footer>
      <span class="dialog-footer">
        <el-button @click="open = false">取消</el-button>
        <el-button type="primary" @click="saveTotal">确认</el-button>
      </span>
    </template>
  </el-dialog>
</template>


<script setup lang="ts">

import OneDayModel from "@/views/club/life/Compent/OneDayModel.vue";
import {ref} from "vue";

let oneDayRef = ref();
let mode =ref('create')

let emit = defineEmits(['refreshLIst'])

let open = ref(false);

let updateList = () => {
  emit('refreshLIst')
  open.value =  false
};

let openNewDialog = (id: any,mode:any) => {
  open.value =  true
};

let saveTotal = () => {
  oneDayRef.value.creatOneDay()
  open.value = false
}

defineExpose({openNewDialog})

</script>

<style scoped lang="scss">

:deep(.el-dialog .el-dialog__header){
  padding: 0;
}


</style>